﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zeus.Thunder.Core;

namespace SharpTrainer.Delegates
{
    class X
    {
        public void InstanceProgress(int percentComplete)
        {
            Console.WriteLine(percentComplete);
        }
    }

    delegate void ProgressReporter2(int percentComplete);
    class InstanceDelegateMethodTest : ITestCase
    {
        public void Run()
        {
            X x = new X();
            ProgressReporter2 p = x.InstanceProgress;
            p(99); // 99
            Console.WriteLine("Target == x: {0}", p.Target == x); // True
            Console.WriteLine(p.Method); // Void InstanceProgress(Int32)
        }
    }
}
